<%@ page contentType="text/html;charset=UTF-8" %>
<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/login.css" />
	<style type="text/css">
	a:link {
 	font-size: 12px;
 	color: #000000;
	text-decoration: none;
	}
	a:visited {
	font-size: 12px;
	color: #000000;
 	text-decoration: none;
	}
	a:hover {
 	font-size: 12px;
 	color: #999999;
 	text-decoration: none;
	}
	</style>
	<title>毕业生简历管理系统</title>
</head>
<body>
<span id="msg" style="display: none">${msg}</span>
	<div id="container">
		<div id="bd">
			<form id="myForm" method="post" onsubmit="checkAddress();">
			<div class="login">
            	<div class="login-top"><h1 class="logo"></h1></div>
                <div class="login-input">
                	<p class="user ue-clear">
                    	<label>用户名</label>
                        <input type="text" name="account" />
                    </p>
                    <p class="password ue-clear">
                    	<label>密&nbsp;&nbsp;&nbsp;码</label>
                        <input type="password" name="password" />
                    </p><br>
                    <label style="font-size:16px">&nbsp;类&nbsp;&nbsp;&nbsp;型</label>
                    &nbsp;&nbsp;&nbsp;<input type="radio" value="个人" name="type" checked/><label style="font-size:16px">个人</label>
                    <input type="radio" value="公司" name="type"/><label style="font-size:16px">公司</label>
					<input type="radio" value="管理员" name="type"/><label style="font-size:16px">管理员</label>
				</div>
                <div class="login-btn ue-clear">
                	<input type="submit" style="width:117px;height:40px;border-radius:10px;background-color:#2E84CD;color:white" value="登录">
                      <a style="font-size:15px;position:relative;left:165px" onclick="tiaozhuan()">
                      <label>&nbsp;&nbsp;&nbsp;&nbsp;点击注册</label></a>
                </div>
            </div>
            </form>
		</div>
	</div>
</body>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<%--<script src="js/vue.js"></script>--%>
<%--<script src="https://unpkg.com/axios/dist/axios.min.js"></script>--%>
<script type="text/javascript">
<%--以下是页面布局的操作--%>
const height = $(window).height();
$("#container").height(height);
$("#bd").css("padding-top",height/2 - $("#myForm").height()/2);

$(window).resize(function(){
	const height = $(window).height();
	$("#bd").css("padding-top",$(window).height()/2 - $("#myForm").height()/2);
	$("#container").height(height);
});

function tiaozhuan(){
	const type = $("input[name='type']:checked").val();
	if(type=="个人")
		location.href="candidateRegister"
	else if(type=="公司")
		location.href="employerRegister"
	else
		alert("您无此权限！")
}
function checkAddress(){
	const type = $("input[name='type']:checked").val();
	if(type=="个人"){
        $("#myForm").attr('action','candidateLogin');
	}else if(type=="公司"){
		$("#myForm").attr('action','employerLogin');
	}else{
		$("#myForm").attr('action','adminLogin');
	}
}

window.onload=function()//用window的onload事件，窗体加载完毕的时候
{
	const spanMsg = document.getElementById("msg");
	const msg = spanMsg.innerText;
	if(msg){
		alert(msg);
	}
}

</script>
</html>